/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package exatrez.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Mansur
 */
@Entity
@Table(name = "ship_visit_file")
@NamedQueries({
    @NamedQuery(name = "ShipVisitFile.findAll", query = "SELECT s FROM ShipVisitFile s")})
public class ShipVisitFile implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "sv_file_id")
    private Integer svFileId;
    
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ship_visit_id")
    private ShipVisit shipVisit;
    
    @Column(name = "document_path")
    private String documentPath;
    
    @Column(name = "content_type")
    private String contentType;
    
    @Column(name = "title")
    private String title;
    
    @Column(name = "delete_flag")
    private String deleted;
    
    @Embedded
    private InfoAudit infoAudit;

    public ShipVisitFile() {
    }

    public ShipVisitFile(Integer svFileId) {
        this.svFileId = svFileId;
    }

    public Integer getSvFileId() {
        return svFileId;
    }

    public void setSvFileId(Integer svFileId) {
        this.svFileId = svFileId;
    }

    public String getDocumentPath() {
        return documentPath;
    }

    public void setDocumentPath(String documentPath) {
        this.documentPath = documentPath;
    }

    public String getContentType() {
        return contentType;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public ShipVisit getShipVisit() {
        return shipVisit;
    }

    public void setShipVisit(ShipVisit shipVisit) {
        this.shipVisit = shipVisit;
    }

    public String getDeleted() {
        return deleted;
    }

    public void setDeleted(String deleted) {
        this.deleted = deleted;
    }

    public InfoAudit getInfoAudit() {
        return infoAudit;
    }

    public void setInfoAudit(InfoAudit infoAudit) {
        this.infoAudit = infoAudit;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (svFileId != null ? svFileId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ShipVisitFile)) {
            return false;
        }
        ShipVisitFile other = (ShipVisitFile) object;
        if ((this.svFileId == null && other.svFileId != null) || (this.svFileId != null && !this.svFileId.equals(other.svFileId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "exatrez.model.ShipVisitFile[ svFileId=" + svFileId + " ]";
    }
    
}
